package com.ty.user.starter.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户信息
 * </p>
 *
 * @author minku
 * @since 2021-10-15
 */
@Getter
@Setter
@TableName("ty_user")
@ApiModel(value = "User对象")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("部门id")
    @TableField("dept_id")
    private Long deptId;

    @ApiModelProperty("用户名")
    @TableField("username")
    private String username;

    @ApiModelProperty("加密密码")
    @TableField("pwd")
    private String pwd;

    @ApiModelProperty("联系人")
    @TableField("real_name")
    private String realName;

    @ApiModelProperty("联系地址")
    @TableField("address")
    private String address;

    @ApiModelProperty("加密盐")
    @TableField("salt")
    private String salt;

    @ApiModelProperty("手机号码")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("身份证号码")
    @TableField("id_card")
    private String idCard;

    @ApiModelProperty("用户头像")
    @TableField("head_url")
    private String headUrl;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("创建用户Id")
    @TableField("create_user_id")
    private Long createUserId;

    @ApiModelProperty("修改时间")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("修改用户Id")
    @TableField("update_user_id")
    private Long updateUserId;

    /**
     * 首次登录即进行激活
     */
    @ApiModelProperty("是否激活")
    @TableField("activate")
    private Boolean activate = false;

    /**
     * 默认新建用户为可用状态
     */
    @ApiModelProperty("状态")
    @TableField("state")
    private Boolean state = true;

    /**
     * 超级管理员标识
     * 拥有该标识则直接获取系统所有权限且不可删除
     */
    @ApiModelProperty("是否超管")
    @TableField("admin")
    private Boolean admin = false;

    /**
     * 自定义字段集合
     * 存储格式建议为json或json数组字符串 {"a":"b"}
     */
    @ApiModelProperty("其它字段")
    @TableField("other")
    private String other;
}
